package com.changgou.controller;

import com.changgou.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: hushengjin
 */
@RestController
@RequestMapping("/business")
@CrossOrigin
public class BusinessController {

    @Autowired
    private BusinessService businessService;

    @PostMapping("/addOrder")
    public String addOrder() {
        String username = "zhangsan";
        int id = 1;
        int count = 5;
        //下单
        businessService.add(username, count, id);
        return "success";
    }

}
